﻿@using AuthoSYS.EF
@model IEnumerable<AppServer>
<div id="ServerList">
    <ul>
        @foreach (AppServer server in Model)
        {
            
            <li id="server_@server.Id" class="jstree-open">
                @Html.ActionLink(@server.ServerName, "Index", "Application", new { serverId = server.Id }, null)
                <ul>
                    @foreach (var app in server.Applications)
                    {                    
                        <li id="app_@app.Id" class="jstree-open">@Html.ActionLink(app.ApplicationName, "Details", "Application", new { Id = app.Id }, null)
                            <ul>
                                <li id="app_modules_@app.Id">@Html.ActionLink("Modules", "Index", "Module", new { appId = app.Id }, null)</li>
                                <li id="app_users_@app.Id">@Html.ActionLink("Users", "Index", "User", new { appId = app.Id }, null)</li>
                                <li id="app_roles_@app.Id">@Html.ActionLink("Roles", "Index", "Role", new { appId = app.Id }, null)</li>
                            </ul>
                        </li>  
                    }
                </ul>
            </li>

        }
       
    </ul>
</div>
@*<script language="javascript" type="text/javascript">

    $(function () {

        $("#ServerList")

        .jstree({ "themes": { "theme": "apple" }, "plugins": ["themes", "html_data", "ui"] })

        .bind("select_node.jstree", function (event, data) {

            location.href = $("#" + data.rslt.obj.attr("id")+" a").attr("href");
        })
        .delegate("a", "click", function (event, data) { event.preventDefault(); })

    });

</script>*@
